<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <title>Title</title>
    <style>
        body{
            margin: 0;
        }
        .left{
            float: left;
        }
        .right{
            float: right;
        }
        .pg-header{
            background-color: cadetblue;
            height: 48px;
            line-height: 48px;
        }
        .pg-header .logo{
            width: 200px;
            background-color: antiquewhite;
            text-align: center; /*左右居中*/
        }
        .pg-header .user{
            background-color: aqua;
            color: white;
            position: relative;
            margin-right: 70px;
        }
        .pg-header .user:hover{
            background-color: darkcyan;     /*当鼠标放到class=user这个div时，背景颜色改变*/
        }
        .pg-header .user .out{
            position: absolute;
            background-color: #dddddd;
            top: 48px;
            width: 100px;
            right: -11px;
            z-index:10;
            display: none;

        }
        .pg-header .user .out a{
            display: block;     /*让a标签变成行级标签*/
        }
        .pg-header .user:hover .out{
            display: block;
        }
        .pg-header .headimage img{
            height:40px;
            border-radius: 50%;  /*设置图像边框为圆形的*/
            width: 40px;
            margin-top: 4px;
        }
        .pg-menu{
            position: absolute;
            background-color: gray;
            top: 48px;
            left: 0;
            bottom: 0;
            width: 200px;
        }
        .pg-content{
            position: absolute;     /*使用absolute，只用改变overflow就可以切换两种模式*/
            background-color: blueviolet;
            top: 48px;
            right: 0;
            left: 200px;
            bottom: 0;
            min-width: 900px;   /* 设置最小宽度，当页面宽度小于900px时，出现滚动条*/
            overflow: auto; /* 当有overflow时，左侧菜单固定（常用方式），当没有overflow时，左侧菜单随着滑轮滚动而移动*/
            z-index:5;
        }
    </style>


</head>
<body>

<div class="pg-header">
    <div class="logo left">logo</div>
    <div class="user right">wqk
        <a class="headimage" href="#">
            <img src="../image/1.jpg" alt="">
        </a>
        <div class="out">
            <a href="#">个人中心</a>
            <a href="#">注销</a>
        </div>
    </div>
</div>
<div class="pg-body">
    <div class="pg-menu">a</div>
    <div class="pg-content">
        <div style="background-color: blueviolet">      <!--此处style，当没有overflow时，内容部分都有背景色-->
            <p style="margin: 0">adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
        </div>
    </div>
</div>
<div class="pg-booter"></div>

</body>
</html>